package com.gaoding.shared.dict.config;

import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 前端静态资源映射
 * @author mobai
 * @since 2021/4/19 18:09
 */
@Component
public class AdminUiConfiguration implements WebMvcConfigurer {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("index.html").addResourceLocations("classpath:/META-INF/admin/dist/index.html");
        registry.addResourceHandler("/admin/**").addResourceLocations("classpath:/META-INF/admin/dist/admin/");
        registry.addResourceHandler("/image/**").addResourceLocations("classpath:/META-INF/admin/dist/image/");
    }
}
